package com.dawnling.greendaodemo.bean;

import com.dawnling.greendaodemo.converter.ObjectConverter;
import com.dawnling.greendaodemo.converter.ObjectListConverter;
import com.dawnling.greendaodemo.converter.StringListConverter;

import org.greenrobot.greendao.annotation.Convert;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

import java.util.List;

@Entity
public class UserBean {
    @Id(autoincrement = true)
    private Long Id;
    private String data;
    private String url;
    private String name;
    @Convert(columnType = String.class, converter = StringListConverter.class)
    private List<String> list;
    @Convert(/**指定转换器 **/converter = ObjectListConverter.class,/**指定数据库中的列字段**/columnType =String.class )
    private List<UserChildBean> userChildBeanList;
    @Convert(converter = ObjectConverter.class, columnType = String.class)
    private UserChildBean userChildBean;
    @Generated(hash = 1910360337)
    public UserBean(Long Id, String data, String url, String name, List<String> list, List<UserChildBean> userChildBeanList, UserChildBean userChildBean) {
        this.Id = Id;
        this.data = data;
        this.url = url;
        this.name = name;
        this.list = list;
        this.userChildBeanList = userChildBeanList;
        this.userChildBean = userChildBean;
    }
    @Generated(hash = 1203313951)
    public UserBean() {}
    public void setId(Long Id) {
        this.Id = Id;
    }
    public Long getId() {
        return Id;
    }
    public String getData() {
        return data;
    }
    public void setData(String data) {
        this.data = data;
    }
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public List<String> getList() {
        return list;
    }
    public void setList(List<String> list) {
        this.list = list;
    }
    public UserChildBean getUserChildBean() {
        return userChildBean;
    }
    public void setUserChildBean(UserChildBean userChildBean) {
        this.userChildBean = userChildBean;
    }
    public List<UserChildBean> getUserChildBeanList() {
        return this.userChildBeanList;
    }
    public void setUserChildBeanList(List<UserChildBean> userChildBeanList) {
        this.userChildBeanList = userChildBeanList;
    }
    @Override
    public String toString() {
        return "\nUserBean{" +
                "Id=" + Id +
                ", data='" + data + '\'' +
                ", url='" + url + '\'' +
                ", name='" + name + '\'' +
                ", list='" + list + '\'' +
                ", userChildBeanList='" + userChildBeanList + '\'' +
                ", userChildBean='" + userChildBean + '\'' +
                '}';
    }
}
